/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.OneCommerceProject.beans;

import com.OneCommerceProject.entities.Fournisseur;
import java.util.HashMap;
import java.util.Map;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

/**
 *
 * @author Aymen
 */
@Stateless
public class FournisseurFacade extends AbstractFacade<Fournisseur> {
    @PersistenceContext(unitName = "OneCommerceProjectPU")
    private EntityManager em;

    @Override
    protected EntityManager getEntityManager() {
        return em;
    }

    public FournisseurFacade() {
        super(Fournisseur.class);
    }

    public Fournisseur findByFourName(String nomfour) {
        Map<String, Object> parameters = new HashMap<String, Object>();
	parameters.put("nomfour", nomfour);		
        return super.findOneResult(Fournisseur.FIND_BY_NOMFOUR, parameters);    
    }
    
}
